{template "content","header"}
<?php
//会员组缓存
$group_cache = getcache('grouplist', 'member');
foreach($group_cache as $_key=>$_value) {
    if(intval($_value['issystem']) == 1) {
        continue;
    }
    $grouplist[$_key] = $_value['name'];
}
?>
<!-- 所在  -->
<div class="path-box wrap2 cl">
    <I class="icon home"></I>
    <span class="path"><a href="{siteurl($siteid)}">新疆维吾尔自治区林业规划院</a></span><span>&nbsp;&gt;&nbsp;</span> 待审核内容列表
</div>
<!-- 内容 -->
<div class="text-list wrap2 cl">
    <div class="inner">
        <!-- 子首页栏目1 -->					 
        <div class="tit cl">
            <div id="second_middle_list">
                <div>
                    <H2>待审核内容列表</H2>
                </div>
            </div>
        </div>
        <table class="message-list">
            <tr>
                <th width="60">ID</th>
                <th><?php echo L('title');?></th>
                <th width="90"><?php echo L('current_steps');?></th>
                <th width="90"><?php echo L('belong_category');?></th>
                <th width="118"><?php echo L('contribute_time');?></th>
                <th width="130"><?php echo L('username');?></th>
                <th width="70"><?php echo L('operations_manage');?></th>
            </tr>
            <?php
                $model_cache = getcache('model','commons');
                foreach ($datas as $r) {
                        $arr_checkid = explode('-',$r['checkid']);

                        $workflowid = $this->categorys[$r['catid']]['workflowid'];
                        if($stepid = $workflows[$workflowid]['steps']) {
                                $stepname = L('steps_'.$stepid);
                        } else {
                                $stepname = '';
                        }
                        $modelname = $model_cache[$arr_checkid[2]]['name'];
                        $flowname = L('workflow_'.$r['status']);
                ?>
                <tr>
                    <td align='center' ><?php echo $arr_checkid[1];?></td>
                    <td align='left' ><a href="javascript:void(0);" onclick='window.open("?m=content&c=index&a=public_preview&steps=<?php echo $r['status']?>&catid=<?php echo $r['catid'];?>&id=<?php echo $arr_checkid[1];?>&pc_hash=<?php echo $_SESSION['pc_hash'];?>","manage")'><?php echo $r['title'];?></a></td>
                    <td align='center' ><?php echo $flowname;?></td>
                    <td align='center' ><a href="?m=content&c=content&a=init&menuid=822&catid=<?php echo $r['catid'];?>"><?php echo $this->_categorys[$r['catid']]['catname'];?></a></td>
                    <td align='center' ><?php echo format::date($r['inputtime'],1);?></td>
                    <td align='center'>
                    <?php
                    if($r['sysadd']==0) {
                        echo $r['username'];
                    }
                    ?></td>
                    <td align='center'>
                        <a href="javascript:;" onclick='audit("<?php echo $r['catid'];?>","<?php echo $arr_checkid[1];?>")'><?php echo L('c_check');?></a>
                    </td>
                </tr>
             <?php }?>
        </table>
        <div id="pages" class="text-c" style="width:100%;">{$pages}</div>
        <BR>
    </div>
</div>

<link href="{CSS_PATH}dialog.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{JS_PATH}dialog.js"></script>

<script type='text/javascript'>
    
    function audit(_catid, _id) {
        art.dialog({
            lock:false,
            title:'内容审核',
            mouse:true, 
            id:'content_m', 
            content:'<span id=cloading ><a href="javascript:ajax_manage(1,\''+_catid+'\',\''+_id+'\')">通过审核</a> | <a href="javascript:ajax_manage(2,\''+_catid+'\',\''+_id+'\')">拒绝</a> |　<a href="javascript:ajax_manage(3,\''+_catid+'\',\''+_id+'\')">删除</a></span>',
            width:200,
            height:50,
            drag:true, 
            fixed:true,
            lock: true
        });
    }
    
    function ajax_manage(type, _catid, _id) {
        if(type==1) {
                $.get('?m=content&c=content&a=pass&ajax_preview=1&catid='+_catid+'&steps=1&id='+_id+'&pc_hash=hEWgCP');
        } else if(type==2) {
                $.get('?m=content&c=content&a=pass&ajax_preview=1&reject=1&catid='+_catid+'&steps=1&id='+_id+'&pc_hash=hEWgCP');
        } else if(type==3) {
                $.get('?m=content&c=content&a=delete&ajax_preview=1&dosubmit=1&catid='+_catid+'&steps=1&id='+_id+'&pc_hash=hEWgCP');
        }
        $('#cloading').html('<font color=red>操作成功！</font>');
        setInterval('window.location.reload()', 2000);
    }
</script>

{template "content","footer"}